package com.roin.learn.springsecurity.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

public enum GenderEnum {
    UNKNOWN(0, "未知"), MALE(1, "男"), FEMALE(2, "女");
    @EnumValue//标记数据库存的值是code
    private final int code;
    @JsonValue//标记响应json值(默认jackjson解析时)
    private final String descp;

    GenderEnum(int code, String descp) {
        this.code = code;
        this.descp = descp;
    }

    @Override
    public String toString() {
        return "{" +
                "code=" + code +
                ", descp='" + descp + '\'' +
                '}';
    }
}
